package server

import (
	"rpc/model"
	"rpc/proto/user"
)

func CreateUser(in *user.UserCreateReq) (*model.User, error) {
	stu := model.User{
		Username: in.Username,
		Password: in.Password,
		Mobile:   in.Mobile,
	}
	err := stu.Create()
	if err != nil {
		return nil, err
	}
	return &stu, nil
}
